#ifndef _Sphere_H_
#define _Sphere_H_

#pragma once
#include "Primitive.h"

class Sphere : public Primitive {
private:
	Vector3 center;
	Double radius;
	Double radiusSqr;
public:
	Sphere(const Vector3 &center, Double r) : center(center), radius(r), radiusSqr(r * r) {}
	~Sphere() {}

	bool intersect(const Ray &ray, IntersectResult &result) const;
	bool intersectP(const Ray &ray) const;

	inline static string getName() {
		return string("Sphere");
	}
	string str() const;
};

#endif // _Sphere_H_